﻿/*
 * Created by SharpDevelop.
 * User: Dean
 * Date: 30/10/2015
 * Time: 6:00 PM
*/
using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
using System.IO.Compression;
using System.Security.Principal;
using System.Diagnostics;

namespace StartMenuSorter
{
	/// <summary>
	/// Description of MainForm.
	/// </summary>
	public partial class MainForm : Form
	{
		protected string userStartMenuFolder = "", allUsersStartMenuFolder = "",
			folderName = "", fileName = "", categoryFolder = "",startMenuBackupsFolder = @"C:\Start Menu Backups";
		protected bool isGamer = true, isDeveloper = true;

		public MainForm()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			// TODO: Check Backup Files are valid
			if(!isAdministrator())
			{
				// Not an Administrator
				buttonSortAllUsersStartMenu.Enabled = false;
				labelSortAllUsersInfo.Text = "(Administator account is required)";
			}
			setVariables();
			if(!Directory.Exists(userStartMenuFolder) || !Directory.Exists(allUsersStartMenuFolder))
			{
				MessageBox.Show("Failed to detect start menu folders.", "Detection of Start Menu Folders Failed",
					MessageBoxButtons.OK, MessageBoxIcon.Error,
					MessageBoxDefaultButton.Button1);
				System.Environment.Exit(1);
			}
			createFolderIfItDoesNotExist(startMenuBackupsFolder);
			setInfoLabels();
			setOptionsFromSettingsFile();
		}
		
		// Sets all Variables
		private void setVariables()
		{
			// Variables
			userStartMenuFolder = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
			allUsersStartMenuFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu);
		}
		private void setOptionsFromSettingsFile()
		{
			// Settings Loaded from Setting file
			//checkBoxAutoBackupStartMenus.Checked = Properties.Settings.StartmenuSorter.autobackupstartmenusbeforesort;
		}
		// Checks whether the current user is an Administrator
		public static bool isAdministrator()
		{
			WindowsIdentity identity = WindowsIdentity.GetCurrent();
			WindowsPrincipal principal = new WindowsPrincipal(identity);
			return principal.IsInRole(WindowsBuiltInRole.Administrator);
		}
		// Sets the text of info labels
		private void setInfoLabels()
		{
			labelBackupInfo.Text += "";
			labelSortUserInfo.Text += userStartMenuFolder;
			labelBackupInfo.Text += startMenuBackupsFolder;
			if(isAdministrator())
			{
				labelSortAllUsersInfo.Text += allUsersStartMenuFolder;
			}
			if(!Directory.Exists(startMenuBackupsFolder))
			{
				buttonBackupStartMenus.Enabled = false;
			}
		}
		// Creates a folder if it does not exist
		private void createFolderIfItDoesNotExist(string folder)
		{
			try
			{
				if(!Directory.Exists(folder))
				{
					Directory.CreateDirectory(folder);
				}
			}
			catch
			{
				
			}
		}
		/*
		 * <summary>Creates Category folders if they don't already exist.</summary>
		 * */
		private void createFolders(bool folderstate)
		{
			if(folderstate == true)
			{
				// Create User Start Menu Folders
				createFolderIfItDoesNotExist(userStartMenuFolder + "\\Programs\\Multimedia");
				createFolderIfItDoesNotExist(userStartMenuFolder + "\\Programs\\Utilities");
				createFolderIfItDoesNotExist(userStartMenuFolder + "\\Programs\\Backup");
				createFolderIfItDoesNotExist(userStartMenuFolder + "\\Programs\\Maintenance");
				createFolderIfItDoesNotExist(userStartMenuFolder + "\\Programs\\Browsers");
				createFolderIfItDoesNotExist(userStartMenuFolder + "\\Programs\\Email");
				if(isAdministrator())
				{
					createFolderIfItDoesNotExist(userStartMenuFolder + "\\Programs\\Administration");
				}
				if(isGamer == true)
				{
					createFolderIfItDoesNotExist(userStartMenuFolder + "\\Programs\\Games");
				}
				if(isDeveloper == true)
				{
					createFolderIfItDoesNotExist(userStartMenuFolder + "\\Programs\\Development");
				}
			}
			else
			{
				// Create All Users Start Menu Folders
				createFolderIfItDoesNotExist(allUsersStartMenuFolder + "\\Programs\\Multimedia");
				createFolderIfItDoesNotExist(allUsersStartMenuFolder + "\\Programs\\Utilities");
				createFolderIfItDoesNotExist(allUsersStartMenuFolder + "\\Programs\\Backup");
				createFolderIfItDoesNotExist(allUsersStartMenuFolder + "\\Programs\\Maintenance");
				createFolderIfItDoesNotExist(allUsersStartMenuFolder + "\\Programs\\Browsers");
				createFolderIfItDoesNotExist(allUsersStartMenuFolder + "\\Programs\\Email");
				if(isAdministrator())
				{
					createFolderIfItDoesNotExist(allUsersStartMenuFolder + "\\Programs\\Administration");
				}
				if(isGamer == true)
				{
					createFolderIfItDoesNotExist(allUsersStartMenuFolder + "\\Programs\\Games");
				}
				if(isDeveloper == true)
				{
					createFolderIfItDoesNotExist(allUsersStartMenuFolder + "\\Programs\\Development");
				}
			}
		}
		/* Copies the contents of one folder to another existing folder (replacing all existing files) */
		public static void copyFolderContentsOverwriting(string sourceFolder, string destinationFolder)
		{
			if(Directory.Exists(sourceFolder))
			{
				// Copy folder structure
				foreach (string sourceSubFolder in Directory.GetDirectories(sourceFolder, "*", SearchOption.AllDirectories))
				{
					Directory.CreateDirectory(sourceSubFolder.Replace(sourceFolder, destinationFolder));
				}

				// Copy files
				foreach (string sourceFile in Directory.GetFiles(sourceFolder, "*", SearchOption.AllDirectories))
				{
					string destinationFile = sourceFile.Replace(sourceFolder, destinationFolder);
					File.Copy(sourceFile, destinationFile, true);
				}
			}
		}

		// Backup Start Menu
		private void backupStartMenu(string startMenuFolder, string backupDestinationZipFile)
		{
			ZipFile.CreateFromDirectory(startMenuFolder, backupDestinationZipFile);
			//MessageBox.Show(backupDestinationZipFile);
		}
		// Moves program folders in a start menu
		private void moveProgramFoldersInStartMenu(string sourceFolder, string destinationFolder)
		{
			// If Source Folder Exists and Destination does not exist then move the folder
			if(Directory.Exists(sourceFolder) && !Directory.Exists(destinationFolder))
			{
				Directory.Move(sourceFolder, destinationFolder);
			}
			else
			{
				if(checkBoxOverwriteExistingShorctcuts.Checked)
				{
					copyFolderContentsOverwriting(sourceFolder, destinationFolder);
					if(Directory.Exists(sourceFolder))
					{
						Directory.Delete(sourceFolder, true);
					}
				}
			}
		}
		// Gets the amount of free disk space for a given drive letter
		private long getFreeDiskSpace(string driveLetter)
		{
			var drive = new DriveInfo(driveLetter);
			return drive.TotalFreeSpace;
		}
		// Deletes a subdirectory if it is empty (all below path)
		private void DeleteDirectoryIfEmpty(string path)
		{
			if(Directory.Exists(path))
			{
				//Delete all child Directories if they are empty
				foreach (string subdirectory in Directory.GetDirectories(path))
				{
					string[] file = Directory.GetFiles(subdirectory, "*.*");
					string[] directory = Directory.GetDirectories(subdirectory, "*.*");
					if(file.Length == 0 && directory.Length == 0)
					{
						// Ignore 3 system folders
						if(!subdirectory.Contains("Startup") && !subdirectory.Contains("Startup-Disabled") && !subdirectory.Contains("Tablet PC"))
						{
							Directory.Delete(subdirectory);
						}
					}
				}
			}
		}
		// Moves program shortcuts (*.lnk) in a start menu
		private bool moveProgramShorcutInStartMenu(string sourceShortcutPath, string destinationFolder)
		{
			if(File.Exists(sourceShortcutPath) && !File.Exists(destinationFolder))
			{
				File.Move(sourceShortcutPath, destinationFolder);
				return true;
			}
			else
			{
				if(checkBoxOverwriteExistingShorctcuts.Checked)
				{
					if(File.Exists(destinationFolder) && File.Exists(sourceShortcutPath))
					{
						File.Replace(sourceShortcutPath, destinationFolder, null);
					}
				}

				return false;
			}
		}
		// Rules for moving folders
		private void moveFolderRules(string startMenu)
		{
			// Rules for moving folders within a Start Menu
			//FolderRule fr = new FolderRule();
			//fr.getFolderRuleSet(categoryFolder);

			// Multimedia
			categoryFolder = "Multimedia";
			string[] multimediaFolders = {"Freemake", "BabelSoft", "Macgo Windows Blu-ray Player", "XBMC", "Thumbnail me 3.0", "DFX Audio Enhancer", "Clementine", "Picasa 3" ,"MSI Afterburner",
										"Wondershare", "Shark007 Codecs", "VideoLAN", "Mp3tag", "DivX", "Youtube Downloader HD", "Lightscreen", "Microsoft Silverlight", "Razer", "iTunes", "RivaTuner Statistics Server", "Lightworks", "Evernote", "ICVT Ltd", "Adobe", "Corel", "Futuremark", "Kodi", "Skype", "Kodi", "Corel PaintShop Pro X7", "RocketDock", "MPC-HC x64", "Sublight", "MusicBee", "Corel PaintShop Pro X8",
										"Tomahawk", "abrMate", "MKVToolNix"};
			foreach(string stringFolder in multimediaFolders)
			{
				moveProgramFoldersInStartMenu(startMenu + stringFolder + "\\",
					startMenu + categoryFolder + "\\" + stringFolder + "\\");
			}
			// Utilities
			categoryFolder = "Utilities";
			string[] utilitiesFolders = {"WinRAR", "Winzip", "TeraCopy", "PeaZip", "Everything", "SABnzbd", "AShampoo", "BurnAware Free", "Sandboxie", "NVIDIA Corporation", "NexusFont", "MEGAsync", "MagicDisc", "JDownloader",
										 "IObit Uninstaller", "Hotspot Shield", "Free Alarm Clock", "Enhanced Mitigation Experience Toolkit", "Chundle", "Binreader", "AutoHotkey", "GIGABYTE", "Logitech", "Java",
										 "OpenOffice 4.1.0", "Nero", "LightScribe Direct Disc Labeling", "Unchecky", "Oracle VM VirtualBox", "Driver Booster 2", "WinMerge", "Google Drive",
										 "NeoSmart Technologies", "Andy", "Windows Virtual PC", "Microsoft Windows AIK", "Microsoft Xbox 360 Accessories", "EULAlyzer", "SoftPerfect RAM Disk", "LibreOffice 4.4", "SurDoc",
										 "Samsung", "VIA XHCI UASP Utility", "WinCDEmu", "IObit Malware Fighter", "CyberGhost 5", "Gigabyte Speed", "Intel", "SpeedFan", "Process Lasso", "Clean Master", "LastPass", "TinyWall",
										 "MiPony", "NifTools", "KeyFreeze", "Unified Remote 3", "WinPcap", "MediaFire Desktop",
										 "GPSoftware"};
			foreach(string stringFolder in utilitiesFolders)
			{
				moveProgramFoldersInStartMenu(startMenu + stringFolder + "\\",
					startMenu + categoryFolder + "\\" + stringFolder + "\\");
			}
			// Maintenance
			categoryFolder = "Maintenance";
			string[] maintenanceFolders = {"Auslogics", "Glary Utilities 5", "CCleaner", "IObit Unlocker", "CrystalDiskMark", "CrystalDiskInfo", "Malwarebytes Anti-Malware", "O&O Software",
										  "SUPERAntiSpyware", "Restore Point Creator", "SpywareBlaster", "Unchecky", "SlimDrivers", "Adobe Reader 64-bit fixes", "VirusTotal Uploader 2.2",
										  "AVG PC TuneUp 2015", "Defraggler", "Intel Driver Update Utility", "Speccy", "Spybot - Search & Destroy 2", "Samsung Magician", "Wise Care 365", "EasyUEFI",
										  "Active@ Disk Image", "Reason Core Security", "Malwarebytes Anti-Exploit", "Bitdefender 2015", "CCleaner Cloud"};
			foreach(string stringFolder in maintenanceFolders)
			{
				moveProgramFoldersInStartMenu(startMenu + stringFolder + "\\",
					startMenu + categoryFolder + "\\" + stringFolder + "\\");
			}
			// Backup
			categoryFolder = "Backup";
			string[] backupFolders = {"Acronis", "Hekasoft Backup & Restore", "MozBackup"};
			foreach(string stringFolder in backupFolders)
			{
				moveProgramFoldersInStartMenu(startMenu + stringFolder + "\\",
					startMenu + categoryFolder + "\\" + stringFolder + "\\");
			}
			// Browsers
			categoryFolder = "Browsers";
			string[] browsersFolders = {"Google Chrome", "Chrome Apps", "Maxthon Nitro"};
			foreach(string stringFolder in browsersFolders)
			{
				moveProgramFoldersInStartMenu(startMenu + stringFolder + "\\",
					startMenu + categoryFolder + "\\" + stringFolder + "\\");
			}
			// Games
			if(isGamer == true)
			{
				categoryFolder = "Games";
				string[] gamesFolders = {"Steam", "Battle.net", "Glyph", "GOG.com", "Uplay", "Metro 2033 Redux", "Origin", "LOOT", "Nexus Mod Manager", "Flawless Widescreen",
										 "Game Assistant", "StarCraft II", "Sherlock Holmes Crimes and Punishments", "World of Warcraft",
										"Call of Duty Advanced Warfare", "Dragon Age Origins", "Dragon Age Inquisition", "Command and Conquer Generals and Zero Hour",
										"Command and Conquer Red Alert 2", "Westwood Online", "Ubisoft", "Far Cry 4", "Mass Effect 3", "Command and Conquer 3 Tiberium Wars and Kane's Wrath",
										"ME3Launcher", "Battlefield 3", "Battlefield 4", "Homeworld Remastered Collection", "Infinite Dreams", "Unofficial Fallout 3 Patch",
										"Heroes of the Storm", "Hearthstone", "Grey Goo", "Broken Age", "Bethesda Softworks",
										"Lara Croft and the Temple of Osiris", "GOG.com", "Electronic Arts Inc"};
				foreach(string stringFolder in gamesFolders)
				{
					moveProgramFoldersInStartMenu(startMenu + stringFolder + "\\",
						startMenu + categoryFolder + "\\" + stringFolder + "\\");
				}
			}
			// Development
			if(isDeveloper == true)
			{
				categoryFolder = "Development";
				string[] gamesFolders = {"phpDesigner 8", "JetBrains", "HeidiSQL", "MySQL", "Apache Server", "Python 3.4", "Android Studio",
					"Java Development Kit", "Python 2.7", "CodeLite", "MONyog", "GitHub, Inc", "Windows Kits", "Microsoft Expression", "Visual Studio 2015"};
				foreach(string stringFolder in gamesFolders)
				{
					moveProgramFoldersInStartMenu(startMenu + stringFolder + "\\",
						startMenu + categoryFolder + "\\" + stringFolder + "\\");
				}
			}

			// Folders: Multimedia, Utilities, Backups, Maintenance
		}
		// Rules for moving shortcut link files (*.lnk)
		private void moveShorcutLinkRules(string startMenu)
		{
			// Rules for moving Shortcut Link files
			// Utilities
			categoryFolder = "Utilities";
			string[] utilityLinks = {"Dev Eject", "TeamViewer 9", "TeamViewer 10", "Adobe Reader XI", "WinZip", "CDBurnerXP", "KeePass 2", "NETGEAR Genie", "µTorrent", "LibreOffice 4.4",
				"Windows Anytime Upgrade", "Acrobat Reader DC", "Acronis True Image 2015", "Acronis True Image 2016"};
			foreach(string stringLink in utilityLinks)
			{
				moveProgramShorcutInStartMenu(startMenu + "\\" + stringLink + ".lnk",
					startMenu + "\\" + categoryFolder + "\\" + stringLink + ".lnk");
			}
			// Maintenance
			categoryFolder = "Maintenance";
			string[] maintenanceLinks = {"Glary Utilities 5", "AVG PC TuneUp 2015", "Spybot-S&D Start Center", "Secunia PSI"};
			foreach(string stringLink in maintenanceLinks)
			{
				moveProgramShorcutInStartMenu(startMenu + "\\" + stringLink + ".lnk",
					startMenu + "\\" + categoryFolder + "\\" + stringLink + ".lnk");
			}
			// Multimedia
			categoryFolder = "Multimedia";
			string[] multimediaLinks = {"paint.net", "PNGGauntlet", "Apple Software Update", "Windows Media Player", "Windows Media Center", "Adobe Creative Cloud", "Adobe Photoshop CC 2014"};
			foreach(string stringLink in multimediaLinks)
			{
				moveProgramShorcutInStartMenu(startMenu + "\\" + stringLink + ".lnk",
					startMenu + "\\" + categoryFolder + "\\" + stringLink + ".lnk");
			}
			// Browsers
			categoryFolder = "Browsers";
			string[] browserLinks = {"Waterfox", "Mozilla Firefox", "Opera", "Opera beta", "Internet Explorer"};
			foreach(string stringLink in browserLinks)
			{
				moveProgramShorcutInStartMenu(startMenu + "\\" + stringLink + ".lnk",
					startMenu + "\\" + categoryFolder + "\\" + stringLink + ".lnk");
			}
			// Email
			categoryFolder = "Email";
			string[] emailLinks = {"Mozilla Thunderbird"};
			foreach(string stringLink in emailLinks)
			{
				moveProgramShorcutInStartMenu(startMenu + "\\" + stringLink + ".lnk",
					startMenu + "\\" + categoryFolder + "\\" + stringLink + ".lnk");
			}
			// Windows Default Links
			categoryFolder = "Administration";
			string[] administrationLinks = {"Default Programs", "Desktop Gadget Gallery", "Windows DVD Maker", "Windows Fax and Scan", "Windows Media Center",
											"Windows Update", "XPS Viewer", "Desktop Gadget Gallery", "Windows Media Center"};
			foreach(string stringLink in administrationLinks)
			{
				moveProgramShorcutInStartMenu(startMenu + "\\" + stringLink + ".lnk",
					startMenu + "\\" + categoryFolder + "\\" + stringLink + ".lnk");
			}
			// Development
			if(isDeveloper == true)
			{
				categoryFolder = "Development";
				string[] developmentLinks = {"SharpDevelop 5.1 Beta 2", "SharpDevelop 5.0", "SharpDevelop 4.4", "Sublime Text 3", "Audacity", "Visual Studio 2015",
					"Blend for Visual Studio 2015"};
				foreach(string stringLink in developmentLinks)
				{
					moveProgramShorcutInStartMenu(startMenu + "\\" + stringLink + ".lnk",
						startMenu + "\\" + categoryFolder + "\\" + stringLink + ".lnk");
				}
			}
			// Gamer
			if(isGamer == true)
			{
				categoryFolder = "Games";
				string[] gameLinks = {"Steam"};
				foreach(string stringLink in gameLinks)
				{
					moveProgramShorcutInStartMenu(startMenu + "\\" + stringLink + ".lnk",
						startMenu + "\\" + categoryFolder + "\\" + stringLink + ".lnk");
				}
			}
			// Folders: Multimedia, Utilities, Backups, Maintenance, Development, Gamer, Email
		}
		private void moveUserStartMenuFolders()
		{
			if(Directory.Exists(userStartMenuFolder))
			{
				moveFolderRules(userStartMenuFolder + "\\Programs\\");
				moveShorcutLinkRules(userStartMenuFolder + "\\Programs\\");				
			}
		}
		private void moveAllUsersStartMenuFolders()
		{
			if(Directory.Exists(allUsersStartMenuFolder))
			{
				moveFolderRules(allUsersStartMenuFolder + "\\Programs\\");
				moveShorcutLinkRules(allUsersStartMenuFolder + "\\Programs\\");
			}
		}

		void ButtonSortUserStartMenuClick(object sender, EventArgs e)
		{
			createFolders(true);
			moveUserStartMenuFolders();
			if(checkBoxOpenStartMenuFolderAfterBackup.Checked)
			{
			Process.Start(userStartMenuFolder + "\\Programs\\");
			}
			if(checkBoxDeleteEmptyFolders.Checked)
			{
				DeleteDirectoryIfEmpty(userStartMenuFolder + "\\Programs\\");
			}
			MessageBox.Show("Current User's Start Menu sorted successfully.", "Sorting Complete",
				MessageBoxButtons.OK, MessageBoxIcon.Information,
				MessageBoxDefaultButton.Button1);
		}
		void ButtonSortAllUsersStartMenuClick(object sender, EventArgs e)
		{
			createFolders(false);
			moveAllUsersStartMenuFolders();
			if(checkBoxOpenStartMenuFolderAfterBackup.Checked)
			{
				Process.Start(allUsersStartMenuFolder + "\\Programs\\");
			}
			if(checkBoxDeleteEmptyFolders.Checked)
			{
				DeleteDirectoryIfEmpty(allUsersStartMenuFolder + "\\Programs\\");
			}
			MessageBox.Show("All Users Start Menu sorted successfully.", "Sorting Complete",
				MessageBoxButtons.OK, MessageBoxIcon.Information,
				MessageBoxDefaultButton.Button1);
		}
		void ButtonBackupStartMenusClick(object sender, EventArgs e)
		{
			if(Directory.Exists(startMenuBackupsFolder) && getFreeDiskSpace(Path.GetPathRoot(startMenuBackupsFolder)) > 10000)
			{
				// Backup Start Menu Items to .zip files
				backupStartMenu(allUsersStartMenuFolder, Path.Combine(startMenuBackupsFolder, "allUsersStartMenuBackup-" + DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss\\.\\zip")));
				backupStartMenu(userStartMenuFolder, Path.Combine(startMenuBackupsFolder, "userStartMenuBackup (" + Environment.UserName + ") "  + DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss\\.\\zip")));
				MessageBox.Show("Start Menu Backup Completed Successfully.", "Start Menu Backup Completed Successfully",
					MessageBoxButtons.OK, MessageBoxIcon.Information,
					MessageBoxDefaultButton.Button1);
			}
			else
			{
				Directory.CreateDirectory(startMenuBackupsFolder);
				if(Directory.Exists(startMenuBackupsFolder))
				{
					// Backup Start Menu Items to .zip files
					backupStartMenu(allUsersStartMenuFolder, Path.Combine(startMenuBackupsFolder, "allUsersStartMenuBackup-" + DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss\\.\\zip")));
					backupStartMenu(userStartMenuFolder, Path.Combine(startMenuBackupsFolder, "userStartMenuBackup (" + Environment.UserName + ") "  + DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss\\.\\zip")));
					MessageBox.Show("Start Menu Backup Completed Successfully.", "Start Menu Backup Completed Successfully",
					MessageBoxButtons.OK, MessageBoxIcon.Information,
					MessageBoxDefaultButton.Button1);
				}
				else
				{
					MessageBox.Show("Start Menu Backup Failed. Unable to create backup folder.", "Start Menu Backup Failed",
					MessageBoxButtons.OK, MessageBoxIcon.Information,
					MessageBoxDefaultButton.Button1);
				}
			}
		}
		
		void LabelBackupInfoClick(object sender, EventArgs e)
		{
			if(Directory.Exists(startMenuBackupsFolder))
			{
				Process.Start(startMenuBackupsFolder);
			}
			else
			{
				labelBackupInfo.ForeColor = Color.Red;
			}
		}
		
		void LabelSortUserInfoClick(object sender, EventArgs e)
		{
			Process.Start(userStartMenuFolder + "\\Programs\\");
		}
		
		void LabelSortAllUsersInfoClick(object sender, EventArgs e)
		{
			Process.Start(allUsersStartMenuFolder + "\\Programs\\");
		}
		
		void LabelSortAllUsersInfoMouseHover(object sender, EventArgs e)
		{
			labelSortAllUsersInfo.Cursor = Cursors.Hand;
		}
		
		void LabelSortUserInfoMouseHover(object sender, EventArgs e)
		{
			labelSortUserInfo.Cursor = Cursors.Hand;
		}
		
		void LabelBackupInfoMouseHover(object sender, EventArgs e)
		{
			labelBackupInfo.Cursor = Cursors.Hand;
		}
		
		void ButtonChangeBackupFolderClick(object sender, EventArgs e)
		{
			if(Directory.Exists(startMenuBackupsFolder))
			{
				folderBrowserDialogBackupFolder.SelectedPath = startMenuBackupsFolder;
			}
			folderBrowserDialogBackupFolder.ShowDialog();
			// TODO: Set Backup Folder Changes
		}
		
		void ButtonRestoreStartMenuClick(object sender, EventArgs e)
		{
			openFileDialogRestoreBackup.ShowDialog();
		}
		
		void ButtonSubmitNewProgramClick(object sender, EventArgs e)
		{
			SupportedListForm slf = new SupportedListForm();
			slf.ShowDialog();
		}

	}
}